class Switch:
    def case1(self):
        print("执行操作1")

    def case2(self):
        print("执行操作2")

    def case3(self):
        print("执行操作3")

    def default(self):
        print("默认操作")

    def switch(self, option):
        method_name = "case" + str(option)
        method = getattr(self, method_name, self.default)
        method()


# 示例
switch_obj = Switch()
switch_obj.switch(1)  # 输出：执行操作1
switch_obj.switch(2)  # 输出：执行操作2
switch_obj.switch(3)  # 输出：执行操作3
switch_obj.switch(4)  # 输出：默认操作